﻿using HamcoWcs.Models.Devices;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace HamcoWcs.Models.TibcoMessage
{
    public class Box
    {
        [XmlElement("BOXNAME")]
        public string BoxName { get; set; }
        [XmlElement("POSITION")]
        public string Position { get; set; }
        //[XmlElement("PALLETBOXQUANTITY")]
        //public string PalletBoxQuantity { get; set; }
        //[XmlElement("PRODUCTQUANTITY")]
        //public string ProductQuantity { get; set; }
        //[XmlElement("SELECTEDQUANTITY")]
        //public string SelectedQuantity { get; set; }
        //[XmlElement("PRODUCTSPECNAME")]
        //public string ProductSpecName { get; set; }
        //[XmlElement("PRODUCTGRADE")]
        //public string ProductGrade { get; set; }
        //[XmlElement("OWNERTYPE")]
        //public string OwnerType { get; set; }
        //[XmlElement("OWNERID")]
        //public string OwnerId { get; set; }
        //[XmlElement("PROCESSOPERATIONNAME")]
        //public string ProcessOperationName { get; set; }
        //[XmlElement("PRODUCTLIST")]
        //public List<Product> PRODUCTLIST { get; set; }
    }

    public class Pallet
    {
        [XmlElement("PALLETNAME")]
        public string PalletName { get; set; }
        [XmlElement("POSITION")]
        public string Position { get; set; }
        [XmlElement("CURRENTPOSITIONTYPE")]
        public string CurrentPositionType { get; set; }
        [XmlElement("CURRENTPOSITIONNAME")]
        public string CurrentPositionName { get; set; }
        [XmlElement("CURRENTZONENAME")]
        public string CurrentZoneName { get; set; }
        [XmlElement("PALLETLOCSTATE")]
        public string PalletLocState { get; set; }
        [XmlElement("TRANSFERSTATE")]
        public string TransferState { get; set; }
    }

    public class Port
    {
        public Port()
        {

        }

        public Port(string portName, string portTransferState, string carrierName)
        {
            PortName = portName;
            PortTransferState = portTransferState;
            CarrierName = carrierName;
        }


        public Port(PconDto pcon) : this(pcon.PortName, pcon.PortState, pcon.UnitId) { }


        [XmlElement("PORTNAME")]
        public string PortName { get; set; }
        [XmlElement("PORTTRANSFERSTATE")]
        public string PortTransferState { get; set; }
        [XmlElement("CARRIERNAME")]
        public string CarrierName { get; set; }
        [XmlElement("PRODUCTNAME")]
        public string ProductName { get; set; }
        [XmlElement("PRODUCTGRADE")]
        public string ProductGrade { get; set; }
        [XmlElement("RELOADFLAG")]
        public string ReloadFlag { get; set; }
    }

    public class Zone
    {
        [XmlElement("ZONENAME")]
        public string ZoneName { get; set; }
        [XmlElement("TOTALCAPACITY")]
        public int TotalCapacity { get; set; }
        [XmlElement("USEDSHELFCOUNT")]
        public int UsedShelfCount { get; set; }
        [XmlElement("EMPTYSHELFCOUNT")]
        public int EmptyShelfCount { get; set; }
        [XmlElement("BLOCKEDEMPTYSHELFCOUNT")]
        public int BlockedEmptyShelfCount { get; set; }
        [XmlElement("RESERVESHELFCOUNT")]
        public int ReserveShelfCount { get; set; }
    }

    public class PalletList
    {
        public PalletList()
        {

        }

        public PalletList(List<Pallet> pallets)
        {
            Pallets = pallets;
        }

        [XmlElement("PALLET")]
        public List<Pallet> Pallets { get; set; }
    }

    public class ZoneList
    {
        public ZoneList()
        {

        }

        public ZoneList(List<Zone> zones)
        {
            Zones = zones;
        }

        [XmlElement("ZONE")]
        public List<Zone> Zones { get; set; }
    }

    public class BoxList
    {
        public BoxList()
        {

        }

        public BoxList(List<Box> boxes)
        {
            Boxes = boxes;
        }

        [XmlElement("BOX")]
        public List<Box> Boxes { get; set; }
    }

    public class PortList
    {
        public PortList()
        {

        }

        public PortList(List<Port> ports)
        {
            Ports = ports;
        }

        [XmlElement("PORT")]
        public List<Port> Ports { get; set; }
    }
}
